home *** CD-ROM | disk | FTP | other *** search
-
-
- (* Dated 1-9-89
- Public domain software from John M. Majkrzak, All rights reserved.
- 1180 Todd Dr.
- Arden Hills, MN 55112
- CIS# 76617,264
-
- This demonstration is only to show how you might use the cURDL()
- procedure written in assembler. See the cURDL.INC file for more
- details.
- *)
-
- Uses
- CRT;
-
- {$I cURDL.inc}
-
- Var
- ChRept,
- Finished: Boolean;
- PrevCh,
- Ch: Char;
- cR, cC: Byte;
-
- Const
- F1U = #59;
- F10U = #68;
- luArr = #75;
- ruArr = #77;
- uuArr = #72;
- duArr = #80;
- AltD = #32;
- AltX = #45;
- AltR = #19;
-
- CurSetU: Set of char = [luArr,ruArr,uuArr,duArr];
-
- Procedure xMsg;
- Begin
- write('Press <ALT> + `X'' to exit, <Alt> + `R'' to toggle REPEAT mode.');
- end;
-
- Function ConfirmFini: Boolean;
- Begin
- ConfirmFini:= True;
- end;
-
- Procedure Extended(Var Fini: Boolean); {Process the extended character.}
- Begin
- Ch:= ReadKey; {Get the extended keypress.}
- If cURDL(Ch, cR, cC) then begin {Here is where cURDL() does its thing}
- {If keypress was a cursor key then}
- If ChRept then write(PrevCh); {See NOTE 1}
- GoToXY(cC, cR); {send the cursor to where user wants}
- end
- else Case ch of
- F1u: begin {GiveHelp} end;
- AltR: ChRept:= NOT(ChRept); {See NOTE 1}
- AltX: Fini:= ConfirmFini;
- F10u: begin {PresentMenu} end;
- end;
- end;
-
- Procedure PaintScreen;
- Begin
- Finished:= False;
- ChRept:= False;
- PrevCh:= ' ';
- Repeat
- Ch:= ReadKey;
- Case ch of
- #00: Extended(Finished);
- #27: Begin {GiveHelp} end;
- #13: If Hi(cwMin)+ WhereY <= Hi(cwMax) then WriteLn
- else write(ch); {Carrage return, NO linefeed}
- ELSE Begin
- Write(ch); {Demo does not prevent scroll.}
- PrevCh:= Ch;
- end;
- end;
- until Finished;
- end;
-
- BEGIN
- TextAttr:= White + Blue * 16;
- ClrScr;
- xMsg;
- TextColor(Black);
- TextBackground(White);
- Window(10,8,70,16); {or change this to whatever size you want.}
- ClrScr;
- PaintScreen;
- END.
-
- Note 1: AltD keypress combination toggles screen drawing Off/On. When on,
- the last character printed will be printed again each time a cursor key
- is pressed.
-
- Other software from John M. Majkrzak:
- VT52.PAS, found on Compuserve BPROGA forum library 2. Public Domain
- SDEFSn.ARC, ditto
- POPTnn.EXE found on Compuserve EDFORUM forum library 2. Shareware.